#!/bin/bash
set -e;

base_dir="$(dirname $0)"

whoname=`whoami`;
/opt/radish-elm/stop.sh||echo "null";
sudo mkdir  -p /opt/radish-elm/Config;sudo chmod -R 755 /opt/radish-elm;
sudo chown -R ${whoname} /opt/radish-elm;



cp -f start.sh stop.sh /opt/radish-elm/;
chmod -R 755 /opt/radish-elm;
if [ -e /opt/radish-elm/Config/Config.json ]; then
    echo "start radish services......";
    /opt/radish-elm/start.sh;
else
    cp Config.json /opt/radish-elm/Config/;
	echo "please config /opt/radish-elm/Config.json, then to start [/opt/radish-elm/start.sh]"

fi;


